﻿using System.Collections.Generic;

namespace lot.SDK
{
    public class CommonDefine
    {
        public static TokenResult token = null; //token
        public static UsersModle userinfo;  //用户登录信息
        public static Device SelectedDevice;//已选择设备
        public static List<point> PolyInfo;
    }
    public class point
    {
        public double lat { get; set; }
        public double lng { get; set; }
        public point(double lng, double lat)
        {
            this.lat = lat;
            this.lng = lng;
        }
    }
    /// <summary>
    /// 用户信息
    /// </summary>
    public class UsersModle
    {
        public int ID { get; set; }
        public string User { get; set; }
        public string Passwords { get; set; }
        public bool IsAdmin { get; set; }
        public string Configs { get; set; }
        public lotConfigs Lotconfig { get; set; }
        public string Monitor { get; set; }
        public WisdomFarming WisdomModule { get; set; }
    }
    /// <summary>
    /// 物联网中心配置信息
    /// </summary>
    public class lotConfigs
    {
        public string ip { get; set; }
        public string port { get; set; }
        public string cert { get; set; }
        public string certpwd { get; set; }
        public string appid { get; set; }
        public string appkey { get; set; }
        public string deviceid { get; set; }
    }

    /// <summary>
    /// 查询设备列表结果
    /// </summary>
    public class DeviceResult
    {
        public int totalCount { get; set; }
        public int pageNo { get; set; }
        public int pageSize { get; set; }
        public List<Device> devices { get; set; }
    }
    /// <summary>
    /// 设备信息
    /// </summary>
    public class Device
    {
        public string deviceId { get; set; }
        public string gatewayId { get; set; }
        public string nodeType { get; set; }
        public string createTime { get; set; }
        public string lastModifiedTime { get; set; }
        public DeviceInfo deviceinfo { get; set; }   //设备
        public List<DeviceServices> services { get; set; } //设备服务
    }
    /// <summary>
    /// 设备详情
    /// </summary>
    public class DeviceInfo
    {
        public string nodeId { get; set; }
        public string name { get; set; }
        public string description { get; set; }
        public string manufacturerId { get; set; }
        public string manufacturerName { get; set; }
        public string mac { get; set; }
        public string location { get; set; }
        public string deviceType { get; set; }
        public string model { get; set; }
        public string protocolType { get; set; }
        public string status { get; set; }
        public string statusDetail { get; set; }
        public string mute { get; set; }
    }
    public class DeviceServices
    {
        public string serviceId { get; set; }
        public string serviceType { get; set; }
        public Dictionary<string, object> data { get; set; }
    }

    public class WisdomFarming
    {
        public int Temperature { get; set; }
        public int Humidity { get; set; }
        public int interval { get; set; }
    }
    public enum CompareResult
    {
        /// <summary>
        /// 相等
        /// </summary>
        ModuleEqual = 1,
        /// <summary>
        /// 低于
        /// </summary>
        ModuleLess,
        /// <summary>
        /// 高于
        /// </summary>
        ModuleLarge,
        /// <summary>
        /// 无小于
        /// </summary>
        ModuleNotLess
    }
}
